#!/bin/sh
set -e
BUILD="$(pwd)"
newline="
"

if test -f "$BUILD"/fribidi_options ; then
    IFS=$newline
    set -- $(cat "$BUILD"/fribidi_options) "$@"
    unset -v IFS
fi

OPTIONS="--enable-static --disable-shared --without-glib"
if "$BUILD"/scripts/test-libmpv ; then
    OPTIONS="$OPTIONS --with-pic"
fi

cd "$BUILD"/fribidi
./bootstrap
./configure --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" $OPTIONS "$@"
